package com.iotek.ssm.service.impl;

import com.iotek.ssm.mapper.AttendanceMapper;
import com.iotek.ssm.pojo.Attendance;
import com.iotek.ssm.pojo.AttendanceQueryVo;
import com.iotek.ssm.pojo.CustomQueryVo;
import com.iotek.ssm.service.AttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("attendanceService")
public class AttendanceServiceImpl implements AttendanceService {

    @Autowired
    private AttendanceMapper attendanceMapper;


    public void addAttendance(Attendance attendance) throws Exception {
    attendanceMapper.addAttendance(attendance);
    }

    public void updateAttendance(Attendance attendance) throws Exception {
attendanceMapper.updateAttendance(attendance);
    }

    public List<Attendance> findAttendanceList(AttendanceQueryVo attendanceQueryVo) throws Exception {
        return attendanceMapper.findAttendanceList(attendanceQueryVo);
    }

    public int getCounts(AttendanceQueryVo attendanceQueryVo) throws Exception {
        return attendanceMapper.getCounts(attendanceQueryVo);
    }

    public float getTotalExtraTimes(CustomQueryVo customQueryVo) throws Exception {
        return attendanceMapper.getTotalExtraTimes(customQueryVo);
    }
}
